<!-- Co-Author stuff -->

<dt class="byline" <%= @pseuds.size > 1 ? "" : 'style="display: none;"' %>>
  <%= label_tag "#{type}_author_attributes_ids_", ts("Select author/pseudonym(s)") %>
</dt>
<dd class="byline" <%= @pseuds.size > 1 ? "" : 'style="display: none;"' %>>
  <%= select_tag "#{type}[author_attributes][ids][]",
      options_from_collection_for_select(@pseuds, :id, :name, @selected_pseuds), :multiple => true %>
</dd>

<% unless @coauthors.blank? %>
<%= ('<select name="' + h(type) + '[author_attributes][coauthors][]" multiple="multiple" style="display: none;">').html_safe %>
  <%= options_from_collection_for_select(@coauthors, :id, :name, @selected_pseuds) %>
</select>
<% end %>

<% if @coauthors.size > 0 %>
  <dt class="byline"><%= ts("Current Co-authors:") %> </dt>
    <dd class="byline">
      <ul>
        <% for author in @coauthors %>
          <li><%=h author.byline %></li>
        <% end %>
      </ul>
    </dd>
<% end %>

<dt class="byline coauthors">
  <%= check_box_tag "co-authors-options-show", "1", nil, :onclick => "toggleFormField('co-authors-options');" %>
</dt>
<dd class="byline coauthors">
  <%= label_tag "co-authors-options-show", ts('Add co-authors?') %>
</dd>
<dd id="co-authors-options">
  <dl class="coauthors">
    <dt><%= label_tag :pseud_byline, ts("Enter co-author name(s):") %></dt>
    <dd>
      <%= text_field :pseud, :byline, :size => 50 %>
      <%= autocomplete_text_field "pseud_byline" %>
    </dd>
  </dl>
</dd>
